package com.sys.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 品牌
 *
 * @author yangjs
 * @email catalpa65@163.com
 * @date 2020-11-09 21:03:00
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 品牌id
     */
    @TableId
    private Long brandId;

    /**
     * 品牌名
     */
    //@NotNull//not be null
    //@NotEmpty//not be null nor empty
    @NotBlank//must not be null and must contain at least one non-whitespace character
    private String name;

    /**
     * 品牌logo地址
     */
    @NotBlank
    @URL
    private String logo;

    /**
     * 介绍
     */
    @NotBlank
    private String descript;

    /**
     * 显示状态[0-不显示；1-显示]
     */
    @NotNull
    //@TableLogic(delval = "0", value = "1")
    private Integer showStatus;

    /**
     * 检索首字母
     */
    @NotBlank
    @Pattern(regexp = "^[a-zA-Z]$")//正则
    private String firstLetter;

    /**
     * 排序
     */
    @NotNull
    @Min(value = 0)//排序大于等于0
    private Integer sort;

}
